{{extend "config_layout.html"}}

{{block menu}}
{{menu('config')}}
{{end}}

{{block sub_menu}}
{{sub_menu(menu_items, 'messages')}}
{{end}}

{{block content_main}}
{{use "jquery"}}
<style type="text/css">
body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,form,p,blockquote,th,td{margin: 0;padding: 0;}
h1,h2,h3,h4,h5,h6{font-size: 100%;font-weight: normal;}
ol,ul,li{list-style: none;}
table {border-collapse: collapse;border-spacing: 0;}
td,th,div{word-break:break-all;word-wrap:break-word;}
form{display:inline;}
* {
outline: none;
}
div {
display: block;
}
img{border:0;}
em,cite{ font-style:normal;}
blockquote{quotes: none;}
blockquote:before,blockquote:after,{content: '';content: none;}
.tr3 td{border-bottom:1px dotted #e4e4e4;}
.tr3 .pick{width:20px;padding:0;}
.tr3 .value{color:#999999;}
.mt10{margin-top:10px;}
.mb10{margin-bottom:10px;}
.mr5{margin-right:5px;}
.p15{padding:15px;}
span.bt2{ background-position:right -5px;}
span.bt2 span{ background-position:left -5px;}
.tr3 .icon{width:22px;padding:0 10px 0 5px;}
.tr3 .value{color:#999999;}
.tr3 p.lh_18,.tr3 .value h4 a,.tr3 .value h4{white-space:nowrap;text-overflow:ellipsis;width:380px;-moz-binding: url('ellipsis.xml#ellipsis');}
.s2{color:#ff5500;}/*org*/
tr {
display: table-row;
vertical-align: inherit;
border-color: inherit;
}
.tr2 td{border-top:1px solid #e4e4e4;border-bottom:1px dotted #e4e4e4;}
.tr2 td em{color:#ff5500;}
.tr2 td{line-height:30px;height:30px;padding:0 2px;}
.tr2 td em{padding:0 3px; font-weight:100;}
.tr2 .adel{margin-top:6px;}

</style>

<table width="100%">
<tr><td height="600" valign="top"> 
<div class="p15"> 
<form action="/config/messages/read" method="post" name="FORM"> 
<input type="hidden" name="ajax" value="1"/> 
   <div class="mb10"> 
   <span class="mr5"><span><input name="" type="checkbox" value="" id="check_all">&nbsp;全选</span></span> 
   <span class="bt2"><span><input name="submit" type="submit" value="标记已读"></input></span></span> 
   <span class="bt2"><span><input name="delete" type="submit" value="删除" onclick="return confirm('确定要删除当前记录吗？');"></input></span></span> 
   <span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>     
    {{if read_flag != 'all':}}<span class="rounded" style="background-color:#ccc"><a href="/config/messages/list?read=all">全部</a></span>{{else:}}全部{{pass}}
    {{if read_flag != '1':}}<span class="rounded" style="background-color:#ccc"><a href="/config/messages/list?read=1">已读</a></span>{{else:}}已读{{pass}}
    {{if read_flag != '0':}}<span class="rounded" style="background-color:#ccc"><a href="/config/messages/list?read=0">未读</a></span>{{else:}}未读{{pass}}
    
   </div><div id="showmessage"></div> 

<table width="100%" class="mb10 z2">  
    <tr class="tr2"><td colspan="6">今天<em>({{=len(data_today)}}条)</em></td></tr> 
    {{for x in data_today:}}
    <tr class="tr3">  
        <td class="pick"><input name="read_item" type="checkbox" value="{{=x['id']}}" class="message_item"/></td> 
        {{if x['read_flag'] :}}
            <td class="icon"><img src="/static/reread.png"/></td> 
        {{pass}}
        {{if not x['read_flag'] :}}
            <td class="icon"><img src="/static/reun.png"/></td> 
        {{pass}}
        <td width="100" style="vertical-align:middle;"> 
            <p>{{=x['type']}}</p> <em class="gray"></em> 
        </td> 
        <td width="100" style="vertical-align:middle;"> 
            <p>{{=x['create_date']}}</p> <em class="gray"></em> 
        </td> 
                        
        <td class="value"> 
            <div>{{<<x['memo']}}</div> 
            <em class="s2"></em>
        </td> 
    </tr>
    {{pass}}
    <tr class="tr2"><td colspan="6">更早<em>({{=len(data_last)}}条)</em></td></tr> 
    {{for x in data_last:}}
    <tr class="tr3">  
        <td class="pick"><input name="read_item" type="checkbox" value="{{=x['id']}}" class="message_item"/></td> 
        {{if x['read_flag'] :}}
            <td class="icon"><img src="/static/reread.png"/></td> 
        {{pass}}
        {{if not x['read_flag'] :}}
            <td class="icon"><img src="/static/reun.png"/></td> 
        {{pass}}
        <td width="40" style="vertical-align:middle;"> 
            <p>{{=x['type']}}</p> <em class="gray"></em> 
        </td> 
        <td width="80" style="vertical-align:middle;"> 
            <p>{{=x['create_date']}}</p> <em class="gray"></em> 
        </td> 
        <td class="value"> 
            <div>{{<<x['memo']}}</div> 
            <em class="s2"></em>
        </td> 
    </tr>
    {{pass}}

</table>
</table>
<script type="text/javascript">
$(function(){
    $('#check_all').click(function(){
        var checked = $(this).attr('checked');
        $('input.message_item').each(function(){
            $(this).attr('checked', checked);
        });
    });
    
});
</script>

{{end}}
